import '../models/social_post_entity.dart';
import '../models/post_comment_entity.dart';

/// 默认社交动态数据
/// 包含8条动态和相关的评论数据
class DefaultSocialDataCollection {
  static SocialDataBundle get defaultSocialData =>
      SocialDataBundle(posts: _defaultPosts, comments: _defaultComments);

  static List<SocialPostEntity> get _defaultPosts => [
    // 动态1 - Alex发布的图片动态
    SocialPostEntity(
      postId: 'post_001',
      authorId: 'user_001', // Alex
      content:
          'I really need to remind everyone: don’t just toss filament in a drawer and forget about it! Earlier, when printing small parts, there were tiny bubbles between layers. I tried reprinting three times and still failed, only to realize the filament had absorbed moisture—recent weather’s been humid, and the unsealed filament sat for a few days and got damp. Now I’ve got a dedicated airtight box with desiccant packs inside. Every time I finish using filament, I roll it up and tuck it in, even sticking a note on the box to mark the opening date. Yesterday, I printed with the properly stored filament, and all the bubbles were gone—even the thin little supports came out perfectly on the first try. Just sharing this small tip so no one wastes filament like I did!',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic1.png', // 使用现有图片作为示例
      publishTime: DateTime.now().subtract(const Duration(hours: 2)),
      likeCount: 12,
      commentCount: 3,
      likedUserIds: [
        'user_002',
        'user_003',
        'user_004',
        'user_005',
        'user_006',
        'user_007',
        'user_008',
      ],
    ),

    // 动态2 - Bella发布的视频动态
    SocialPostEntity(
      postId: 'post_002',
      authorId: 'user_001', // Bella
      content:
          'Who would’ve thought my new printer would have issues on the first use? When printing a simple phone stand, the nozzle just poked right through the model. I spent ages trying to figure out why, and finally realized the vertical distance wasn’t adjusted right—the displayed gap was way off from the actual one. Followed a tutorial from the community, using a piece of paper to test and adjust little by little. After nearly half an hour of tweaking, the first layer finally stuck perfectly to the bed, not even a hint of warping on the edges. To all newbies out there: don’t rush to start printing with a new machine. Get the basic parameters right first, otherwise you’ll just waste filament for no reason!',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic2.png',
      publishTime: DateTime.now().subtract(const Duration(hours: 4)),
      likeCount: 8,
      commentCount: 2,
      likedUserIds: ['user_001', 'user_003', 'user_005', 'user_007'],
    ),

    // 动态3 - Chris发布的图片动态
    SocialPostEntity(
      postId: 'post_003',
      authorId: 'user_003', // Chris
      content:
          'Stumbled upon a place to download model files by accident - there are tons of practical models made by other users, and you can download them directly without signing up. Super convenient! Yesterday, I found a model for a foldable small toolbox, and when I opened the file, the creator even included printing tips: what type of filament to use, roughly what temperature to set. I followed the suggestions, and it printed perfectly on the first try. When unfolded, the toolbox holds several small tools, so I don\'t have to hunt for them everywhere anymore. The only thing is, loading can be a bit slow - so I\'d suggest downloading the models you need in advance, that way you won\'t be in a rush when it\'s time to print.',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic3.png',
      publishTime: DateTime.now().subtract(const Duration(hours: 6)),
      likeCount: 15,
      commentCount: 5,
      likedUserIds: [
        'user_001',
        'user_002',
        'user_004',
        'user_005',
        'user_006',
        'user_007',
        'user_008',
      ],
    ),

    // 动态4 - David发布的图片动态
    SocialPostEntity(
      postId: 'post_004',
      authorId: 'user_004', // David
      content:
          'I used to use regular tweezers to remove supports—either I couldn’t grip small parts, or I’d poke little holes in the model when I squeezed too hard. Then I switched to tweezers made specifically for support removal, and only then did I realize how easy removing supports could be! The tips of these tweezers are rounded and have a slight non-slip texture. When taking off those thin supports, a gentle pinch is all it takes to get them off, and they can even reach into really narrow gaps. They’re not expensive either, but they’ve saved me so much time—no more ruining models just because I’m removing supports. Newbies should definitely give these specialized tools a try.',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic4.png',
      publishTime: DateTime.now().subtract(const Duration(hours: 8)),
      likeCount: 6,
      commentCount: 1,
      likedUserIds: ['user_001', 'user_003', 'user_005'],
    ),

    // 动态5 - Emma发布的视频动态
    SocialPostEntity(
      postId: 'post_005',
      authorId: 'user_005', // Emma
      content:
          'Tried resin printing for the first time, picked a small-sized figure model, and almost had an accident! I wasn’t wearing gloves when pouring the resin, and accidentally spilled a little on the table. When I wiped it with alcohol, I didn’t notice an open flame nearby—suddenly there was white smoke everywhere. Luckily, I reacted fast and handled it in time. Later, I checked some info and found out that mixtures of resin and alcohol are flammable, so you have to keep them far away from fire sources. Now, every time I print, I wear two layers of gloves and open the windows all the way for ventilation. The finished details are amazing—even the tiny patterns on small parts are clear—but newbies really need to take proper safety precautions with this printing method.',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic5.png',
      publishTime: DateTime.now().subtract(const Duration(hours: 12)),
      likeCount: 20,
      commentCount: 4,
      likedUserIds: [
        'user_001',
        'user_002',
        'user_003',
        'user_004',
        'user_006',
        'user_007',
        'user_008',
      ],
    ),

    // 动态6 - Frank发布的图片动态
    SocialPostEntity(
      postId: 'post_006',
      authorId: 'user_006', // Frank
      content:
          'The handle on one of my drawers broke, and I couldn\'t find an identical replacement anywhere, so I just designed a model myself and printed it. I chose a more flexible filament - it\'s even sturdier than the original handle. I also added a bit of non-slip texture to make it more comfortable to hold. I left a screw hole at the bottom when printing, so I just screwed it on, and it worked right away. The total cost was just a few dollars, way cheaper than buying a new one. Now, when I look at things around the house, I keep thinking, "I could probably print a part to fix that." There\'s something really satisfying about solving problems with your own hands.',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic6.png',
      publishTime: DateTime.now().subtract(const Duration(hours: 16)),
      likeCount: 9,
      commentCount: 2,
      likedUserIds: ['user_001', 'user_003', 'user_005', 'user_007'],
    ),

    // 动态7 - Grace发布的图片动态
    SocialPostEntity(
      postId: 'post_007',
      authorId: 'user_007', // Grace
      content:
          'Urgent question for everyone! When printing a hemispherical lampshade, there are always wavy lines on the surface. I’ve tried lowering the temperature, slowing down the printing speed, even replacing the nozzle with a new one—but nothing works. The wavy lines are especially noticeable on the more curved parts, making it look really uneven. I’m not sure if it’s a problem with the slicer settings, or if one of the machine’s axes isn’t adjusted right? I posted a photo of the finished piece in the comments—has anyone had this issue before? Could you give me some tips on how to fix it?',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic7.png',
      publishTime: DateTime.now().subtract(const Duration(hours: 20)),
      likeCount: 11,
      commentCount: 3,
      likedUserIds: [
        'user_001',
        'user_002',
        'user_004',
        'user_005',
        'user_006',
      ],
    ),

    // 动态8 - Henry发布的视频动态
    SocialPostEntity(
      postId: 'post_008',
      authorId: 'user_008', // Henry
      content:
          'Started preparing holiday gifts a month early! This year, I’m making a small name plaque for a friend—drew her favorite pattern on the front, and engraved a little message on the back. I used gradient filament, and the color transition on the print is really smooth—way more special than a store-bought gift. I also printed a few small Christmas tree ornaments, each with a little hole for a string, so I can just thread a red string through and hang them on the tree. Now, I sit by the printer every night after work, watching the parts take shape little by little. That feeling of anticipation is even better than receiving a gift myself.',
      mediaType: PostMediaType.image,
      mediaUrl: 'assets/images/dynamic8.png',
      publishTime: DateTime.now().subtract(const Duration(hours: 24)),
      likeCount: 7,
      commentCount: 1,
      likedUserIds: ['user_001', 'user_003', 'user_005'],
    ),
  ];

  static List<PostCommentEntity> get _defaultComments => [
    // 动态1的评论 - 关于线材存储的讨论
    PostCommentEntity(
      commentId: 'comment_001',
      postId: 'post_001',
      authorId: 'user_002', // Bella
      content:
          'Oh wow, I had the exact same problem! Those tiny bubbles drove me crazy. Thanks for sharing this tip!',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 1, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_002',
      postId: 'post_001',
      authorId: 'user_003', // Chris
      content:
          'Great advice! I\'ve been using silica gel packets too. What brand of airtight box do you recommend?',
      commentTime: DateTime.now().subtract(const Duration(hours: 1)),
    ),
    PostCommentEntity(
      commentId: 'comment_003',
      postId: 'post_001',
      authorId: 'user_005', // Emma
      content:
          'I never thought humidity could cause this! Going to check my filament storage right now.',
      commentTime: DateTime.now().subtract(const Duration(minutes: 45)),
    ),

    // 动态2的评论 - 关于新打印机调试的讨论
    PostCommentEntity(
      commentId: 'comment_004',
      postId: 'post_002',
      authorId: 'user_001', // Alex
      content:
          'Been there! The paper test is a lifesaver. Which tutorial did you follow?',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 3, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_005',
      postId: 'post_002',
      authorId: 'user_004', // David
      content:
          'Half an hour of tweaking is totally worth it for perfect first layers!',
      commentTime: DateTime.now().subtract(const Duration(hours: 3)),
    ),

    // 动态3的评论 - 关于模型下载网站的讨论
    PostCommentEntity(
      commentId: 'comment_006',
      postId: 'post_003',
      authorId: 'user_001', // Alex
      content:
          'Can you share the website link? I\'m always looking for good model sources!',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 5, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_007',
      postId: 'post_003',
      authorId: 'user_002', // Bella
      content: 'That toolbox sounds perfect! How long did it take to print?',
      commentTime: DateTime.now().subtract(const Duration(hours: 5)),
    ),
    PostCommentEntity(
      commentId: 'comment_008',
      postId: 'post_003',
      authorId: 'user_006', // Frank
      content:
          'I love when creators include printing tips in the files. So helpful!',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 4, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_009',
      postId: 'post_003',
      authorId: 'user_007', // Grace
      content: 'The slow loading is worth it for free models with tips!',
      commentTime: DateTime.now().subtract(const Duration(hours: 4)),
    ),
    PostCommentEntity(
      commentId: 'comment_010',
      postId: 'post_003',
      authorId: 'user_008', // Henry
      content: 'Downloading in advance is such a smart tip!',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 3, minutes: 30),
      ),
    ),

    // 动态4的评论 - 关于支撑移除工具的讨论
    PostCommentEntity(
      commentId: 'comment_011',
      postId: 'post_004',
      authorId: 'user_001', // Alex
      content:
          'I need to get these specialized tweezers! Regular ones are so frustrating.',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 7, minutes: 30),
      ),
    ),

    // 动态5的评论 - 关于树脂打印安全的讨论
    PostCommentEntity(
      commentId: 'comment_012',
      postId: 'post_005',
      authorId: 'user_001', // Alex
      content:
          'That sounds scary! Thanks for the safety warning - very important!',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 11, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_013',
      postId: 'post_005',
      authorId: 'user_003', // Chris
      content:
          'Resin and alcohol are definitely flammable! Good thing you reacted quickly.',
      commentTime: DateTime.now().subtract(const Duration(hours: 11)),
    ),
    PostCommentEntity(
      commentId: 'comment_014',
      postId: 'post_005',
      authorId: 'user_004', // David
      content:
          'The detail quality is amazing though! Worth the extra safety precautions.',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 10, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_015',
      postId: 'post_005',
      authorId: 'user_006', // Frank
      content: 'Two layers of gloves and ventilation - noted! Safety first.',
      commentTime: DateTime.now().subtract(const Duration(hours: 10)),
    ),

    // 动态6的评论 - 关于DIY修复的讨论
    PostCommentEntity(
      commentId: 'comment_016',
      postId: 'post_006',
      authorId: 'user_001', // Alex
      content:
          'That\'s the beauty of 3D printing - you can fix almost anything!',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 15, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_017',
      postId: 'post_006',
      authorId: 'user_003', // Chris
      content:
          'The non-slip texture addition is genius! Much better than the original.',
      commentTime: DateTime.now().subtract(const Duration(hours: 15)),
    ),

    // 动态7的评论 - 关于打印问题的求助
    PostCommentEntity(
      commentId: 'comment_018',
      postId: 'post_007',
      authorId: 'user_001', // Alex
      content:
          'Have you tried adjusting the Z-axis calibration? That might help with the wavy lines.',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 19, minutes: 30),
      ),
    ),
    PostCommentEntity(
      commentId: 'comment_019',
      postId: 'post_007',
      authorId: 'user_002', // Bella
      content:
          'I had similar issues with curved prints. Try reducing the layer height to 0.1mm.',
      commentTime: DateTime.now().subtract(const Duration(hours: 19)),
    ),
    PostCommentEntity(
      commentId: 'comment_020',
      postId: 'post_007',
      authorId: 'user_004', // David
      content:
          'Check your belt tension too! Loose belts can cause those wavy patterns.',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 18, minutes: 30),
      ),
    ),

    // 动态8的评论 - 关于节日礼物的讨论
    PostCommentEntity(
      commentId: 'comment_021',
      postId: 'post_008',
      authorId: 'user_001', // Alex
      content:
          'Gradient filament for gifts is such a nice touch! Your friend will love it.',
      commentTime: DateTime.now().subtract(
        const Duration(hours: 23, minutes: 30),
      ),
    ),
  ];
}

/// 社交数据包
/// 包含动态和评论的集合
class SocialDataBundle {
  final List<SocialPostEntity> posts;
  final List<PostCommentEntity> comments;

  const SocialDataBundle({required this.posts, required this.comments});
}
